package com.company;

public class Test23回文数 {
    public static void main(String[] args) {
        System.out.println(huiwen(123456));
    }

    public static int huiwen(int x){
        int tmp = 0;

        while(x!=0){
            tmp = tmp*10 + (x %10);
            x = x / 10;
        }
        return tmp;
    }
}
